package appconfig

import (
	"fmt"
	"github.com/elastic/go-elasticsearch/v7"
	"grpc/basic/global"
)

func InitEs() {
	cfg := elasticsearch.Config{
		Addresses: []string{
			global.ConfigData.Es.Host,
		},
		// ...
	}
	global.Ela, err = elasticsearch.NewClient(cfg)
	if err != nil {
		panic(err)
	} else {
		fmt.Println("es连接成功")
	}
}
